package edu.friday.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysMenuVO implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "menuId")
    private Long menuId;

    //菜单名称
    @NotBlank(message = " 菜单名称不能为空 ")
    @Size(min=0,max=50,message = " 菜单名称长度不能超过50个字符 ")
    private String menuName;

    //父级菜单名称
    private String parentName;

    private Long parentId;

    @NotBlank(message = " 显示顺序不能为空 ")
    private String orderNum;

    //路由地址
    @Size(min = 0,max = 200, message = " 路由地址不能超过200个字符 ")
    private String path;

    //组件路径
    @Size(min = 0,max = 200,message = " 组件路径不能超过255个字符 ")
    private String component;
    //是否为外链
    private String isFrame;
    //类型
    @NotBlank(message = " 菜单类型不能为空 ")
    private String menuType;


    private String visible;

    //权限字符串
    @Size(min = 0,max = 100,message = " 权限标识长度不能超过100个字符 ")
    private String perms;

    private String icon;
    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    private String remark;

    //子菜单
    private List<SysMenuVO> children = new ArrayList<SysMenuVO>();
}
